<?php

namespace app\api\controller\questions;

use app\api\controller\Controllers;
use app\api\service\questions\ExaminationType as ExaminationTypeService;

class ExaminationType extends Controllers
{
    /**
     * 获取考试类型
     * @param ExaminationTypeService $service
     *
     * @return \think\Response
     */
    public function getType( ExaminationTypeService $service )
    {
        return success( $service->getType(1) );
    }

    /**
     * 获取考试类型列表
     * @param ExaminationTypeService $service
     * @return \think\Response
     */
    public function lists( ExaminationTypeService $service )
    {
        return success($service->lists());
    }

    /**
     * 获取用户的考试类型
     * @param ExaminationTypeService $service
     * @return \think\Response
     */
    public function mine( ExaminationTypeService $service )
    {
        return success($service->mine());
    }

    /**
     * 设置用户考试类型
     *
     * @return \think\Response
     */
    public function setting( ExaminationTypeService $service )
    {
        return $service->setting($this->request->only([
            'examination_type','examination_section','examination_discipline','examination_area'
        ], 'post'))?success():failed('设置失败');
    }

}
